<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Teacher Information</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <div>
            <asp:Panel ID="Panel1" runat="server" Height="754px" Width="924px">
                <asp:Panel ID="Panel2" runat="server" Height="70px" Width="923px">
                    <h1 style="text-align: center">
                        <span style="text-decoration: underline">Govt.Emerson College Multan</span></h1>
                </asp:Panel>
                <asp:Panel ID="Panel3" runat="server" Width="921px">
                    <h2 style="text-align: center">
                        <span style="text-decoration: underline">Teachers Information</span></h2>
                </asp:Panel>
                <br />
                <asp:Label ID="Label1" runat="server" Text="Teacher Name:" Width="95px"></asp:Label>
                <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><br />
                <asp:Label ID="Label2" runat="server" Text="Father's Name:" Width="93px"></asp:Label>
                <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox><br />
                <asp:Label ID="Label3" runat="server" Text="Address:" Width="93px"></asp:Label>
                <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox><br />
                <asp:Label ID="Label4" runat="server" Text="Qualification:" Width="93px"></asp:Label>
                <asp:TextBox ID="TextBox4" runat="server"></asp:TextBox><br />
                <asp:Label ID="Label5" runat="server" Text="Joining date" Width="93px"></asp:Label>
                <asp:TextBox ID="TextBox5" runat="server"></asp:TextBox><br />
                <asp:Label ID="Label6" runat="server" Text="Ending Date:" Width="93px"></asp:Label>
                <asp:TextBox ID="TextBox6" runat="server"></asp:TextBox><br />
                <asp:Label ID="Label7" runat="server" Text="Desitation:" Width="93px"></asp:Label>
                <asp:TextBox ID="TextBox7" runat="server"></asp:TextBox><br />
                <asp:Button ID="Button1" runat="server" Text="Reset" Width="68px" />
                <asp:Button ID="Button2" runat="server" Text="Ok" Width="68px" />
                <br />
                <br />
                <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                    DataKeyNames="teacherID" DataSourceID="SqlDataSource1" 
                    EmptyDataText="There are no data records to display." Width="636px" 
                    BackColor="#DEBA84" BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" 
                    CellPadding="3" CellSpacing="2">
                    <Columns>
                        <asp:BoundField DataField="teacherID" HeaderText="teacherID" ReadOnly="True" 
                            SortExpression="teacherID" />
                        <asp:BoundField DataField="tName" HeaderText="tName" SortExpression="tName" />
                        <asp:BoundField DataField="TFname" HeaderText="TFname" 
                            SortExpression="TFname" />
                        <asp:BoundField DataField="tNIC" HeaderText="tNIC" SortExpression="tNIC" />
                        <asp:BoundField DataField="tAddress" HeaderText="tAddress" 
                            SortExpression="tAddress" />
                        <asp:BoundField DataField="tContact" HeaderText="tContact" 
                            SortExpression="tContact" />
                        <asp:BoundField DataField="tQulification" HeaderText="tQulification" 
                            SortExpression="tQulification" />
                        <asp:BoundField DataField="status" HeaderText="status" 
                            SortExpression="status" />
                    </Columns>
                    <FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
                    <HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
                    <PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
                    <RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
                    <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
                    <SortedAscendingCellStyle BackColor="#FFF1D4" />
                    <SortedAscendingHeaderStyle BackColor="#B95C30" />
                    <SortedDescendingCellStyle BackColor="#F1E5CE" />
                    <SortedDescendingHeaderStyle BackColor="#93451F" />
                </asp:GridView>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:AdmissionSystemConnectionString1 %>" 
                    DeleteCommand="DELETE FROM [teacher] WHERE [teacherID] = @teacherID" 
                    InsertCommand="INSERT INTO [teacher] ([tName], [TFname], [tNIC], [tAddress], [tContact], [tQulification], [status]) VALUES (@tName, @TFname, @tNIC, @tAddress, @tContact, @tQulification, @status)" 
                    ProviderName="<%$ ConnectionStrings:AdmissionSystemConnectionString1.ProviderName %>" 
                    SelectCommand="SELECT [teacherID], [tName], [TFname], [tNIC], [tAddress], [tContact], [tQulification], [status] FROM [teacher]" 
                    UpdateCommand="UPDATE [teacher] SET [tName] = @tName, [TFname] = @TFname, [tNIC] = @tNIC, [tAddress] = @tAddress, [tContact] = @tContact, [tQulification] = @tQulification, [status] = @status WHERE [teacherID] = @teacherID">
                    <DeleteParameters>
                        <asp:Parameter Name="teacherID" Type="Int32" />
                    </DeleteParameters>
                    <InsertParameters>
                        <asp:Parameter Name="tName" Type="String" />
                        <asp:Parameter Name="TFname" Type="String" />
                        <asp:Parameter Name="tNIC" Type="Int32" />
                        <asp:Parameter Name="tAddress" Type="String" />
                        <asp:Parameter Name="tContact" Type="String" />
                        <asp:Parameter Name="tQulification" Type="String" />
                        <asp:Parameter Name="status" Type="String" />
                    </InsertParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="tName" Type="String" />
                        <asp:Parameter Name="TFname" Type="String" />
                        <asp:Parameter Name="tNIC" Type="Int32" />
                        <asp:Parameter Name="tAddress" Type="String" />
                        <asp:Parameter Name="tContact" Type="String" />
                        <asp:Parameter Name="tQulification" Type="String" />
                        <asp:Parameter Name="status" Type="String" />
                        <asp:Parameter Name="teacherID" Type="Int32" />
                    </UpdateParameters>
                </asp:SqlDataSource>
                <br />
                <asp:DetailsView ID="DetailsView1" runat="server" AllowPaging="True" 
                    AutoGenerateRows="False" DataKeyNames="teacherID" DataSourceID="SqlDataSource1" 
                    Height="50px" Width="253px">
                    <Fields>
                        <asp:BoundField DataField="tName" HeaderText="Teacher Name:" 
                            SortExpression="tName" />
                        <asp:BoundField DataField="tNIC" HeaderText="NIC No." SortExpression="tNIC" />
                        <asp:BoundField DataField="tAddress" HeaderText="Address" 
                            SortExpression="tAddress" />
                        <asp:BoundField DataField="tContact" HeaderText="Contact" 
                            SortExpression="tContact" />
                        <asp:BoundField DataField="tQulification" HeaderText="Qulification" 
                            SortExpression="tQulification" />
                        <asp:BoundField DataField="status" HeaderText="status" 
                            SortExpression="status" />
                        <asp:CommandField ShowInsertButton="True" />
                    </Fields>
                </asp:DetailsView>
            </asp:Panel>
        </div>
    
    </div>
    </form>
</body>
</html>
